<template>
    <h2>用户显示</h2>
    <table>
        <thead>
            <tr>
                <th>用户名</th>
                <th>密码</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr v-for="i in data" :key="i.Uid">
                <td>{{ i.Uname }}</td>
                <td>{{ i.Password }}</td>
                <td>{{ i.State == 0 ? "启用" : "禁用" }}</td>
                <td>

                </td>
            </tr>
        </tbody>
    </table>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
import axios from 'axios'
const data: any = ref([])
onMounted(() => {
    show();
})
const show = () => {
    axios.get("http://localhost:50394/api/Role/PanType", {
        params: {
            Uid: route.params.Uid
        }
    })
        .then(res => {
            console.log(res.data)
            data.value = res.data
        })
        .catch(err => {
            console.log(err)
        })
}
</script>